using System;
using System.Data;
using System.Linq;
using System.ComponentModel;
using System.Reflection;
using System.Collections.Generic;
using DataObject.Model;
using DataObject.Database;

	public partial class ServiceProviderMapper
	{
		#region ToEntity

		public static ServiceProvider ToEntity(ServiceProvider entity, ServiceProviderDTO businessobject)
		{
			if (businessobject == null)
			{
				return null;
			}
            entity.NightFlag = businessobject.NightFlag;
			entity.ChoiceOption = businessobject.ChoiceOption;
			entity.NumInPackage = businessobject.NumInPackage;
			entity.OtherUom = businessobject.OtherUom;
			entity.PackagePrice = businessobject.PackagePrice;
			entity.Currency = businessobject.Currency;
			entity.ProviderID = businessobject.ProviderID;
            entity.UnitPrice = businessobject.UnitPrice;
			entity.ServiceID = businessobject.ServiceID;
            entity.Unit = businessobject.Unit;
			entity.ServiceProviderID = businessobject.ServiceProviderID;
			return entity;
		}

		#endregion

		#region ToBusinessObject

		public static ServiceProviderDTO ToBusinessObject(ServiceProvider entity)
		{
			if (entity == null)
			{
				return null;
			}
			return new ServiceProviderDTO
			{
                NightFlag = entity.NightFlag,
				ChoiceOption = entity.ChoiceOption,
				NumInPackage = entity.NumInPackage,
				OtherUom = entity.OtherUom,
				PackagePrice = entity.PackagePrice,
                Currency = entity.Currency,
				ProviderID = entity.ProviderID,
                UnitPrice = entity.UnitPrice,
				ServiceID = entity.ServiceID,
                Unit = entity.Unit,
				ServiceProviderID = entity.ServiceProviderID,
				Provider = ProviderMapper.ToBusinessObject(entity.ProviderEntity),
				Service = ServiceMapper.ToBusinessObject(entity.Service)
			};
		}

		#endregion

		#region ToBusinessObjectHasChildren

		public static ServiceProviderDTO ToBusinessObjectHasChildren(ServiceProvider entity, params Type[] types)
		{
			if (entity == null)
			{
				return null;
			}
			ServiceProviderDTO businessobject = new ServiceProviderDTO
			{
                NightFlag = entity.NightFlag,
                ChoiceOption = entity.ChoiceOption,
                NumInPackage = entity.NumInPackage,
                OtherUom = entity.OtherUom,
                PackagePrice = entity.PackagePrice,
                Currency = entity.Currency,
                ProviderID = entity.ProviderID,
                UnitPrice = entity.UnitPrice,
                ServiceID = entity.ServiceID,
                Unit = entity.Unit,
                ServiceProviderID = entity.ServiceProviderID,
				Provider = ProviderMapper.ToBusinessObject(entity.ProviderEntity),
				Service = ServiceMapper.ToBusinessObject(entity.Service)
			};
			return businessobject;
		}

		#endregion

	}